//
//  MTUI.h
//  FaceLink
//
//  Created by Apple on 2023/7/18.
//

#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>

NS_ASSUME_NONNULL_BEGIN

@interface MTUI : NSObject

+ (UIView *)viewWithFrame:(CGRect)frame
          backgroundColor:(UIColor *)backgroundColor;

+ (UILabel *)labelWithFont:(nullable UIFont *)font
             textAlignment:(NSTextAlignment)alignment
                 textColor:(nullable UIColor *)textColor
             numberOflines:(NSInteger)numberOflines
                      text:(NSString *)text
                    enable:(BOOL)enable;

+ (UIImageView *)imageViewWithImage:(nullable UIImage *)image
                        contentMode:(UIViewContentMode)mode;


+ (UIButton *)btnWithTitle:(nullable NSString *)title
                 titleFont:(nullable UIFont *)titleFont
                titleColor:(nullable UIColor *)titleColor
           backgroundColor:(nullable UIColor *)backGroundColor
                    target:(nullable id)target
                    action:(nullable SEL)action;

+ (UIButton *)btnWithImage:(nullable UIImage *)image
                    target:(nullable id)target
                    action:(nullable SEL)action;

+ (UIButton *)btnWithNormalImage:(nullable UIImage*)normalImg
                     selectedImg:(nullable UIImage *)selectImg
                          target:(nullable id)target
                          action:(nullable SEL)action;

+ (UIButton *)btnWithType:(UIButtonType)btnType
                    title:(nullable NSString *)title
                titleFont:(nullable UIFont *)titleFont
               titleColor:(nullable UIColor *)titleColor
          backgroundColor:(nullable UIColor *)backGroundColor
                   target:(nullable id)target
                   action:(nullable SEL)action;

+(UITableView *)tableViewWithFrame:(CGRect)frame
                             style:(UITableViewStyle)style
                          delegate:(nullable id)delegate
                        dataSource:(nullable id)dataSource
                         rowHeight:(CGFloat)rowHeight
                estimatedRowHeight:(CGFloat)estimatedRowHeight
               sectionHeaderHeight:(CGFloat)sectionHeaderHeight
               sectionFooterHeight:(CGFloat)sectionFooterHeight
      estimatedSectionHeaderHeight:(CGFloat)estimatedSectionHeaderHeight
      estimatedSectionFooterHeight:(CGFloat)estimatedSectionFooterHeight
    showsHorizontalScrollIndicator:(BOOL)showsHorizontalScrollIndicator
      showsVerticalScrollIndicator:(BOOL)showsVerticalScrollIndicator
                    separatorStyle:(UITableViewCellSeparatorStyle)separatorStyle
                   backgroundColor:(UIColor *)backgroundColor;

+ (UITextField *)textFieldWithFrame:(CGRect)frame
                               font:(UIFont *)font
                      textAlignment:(NSTextAlignment)textAlignment
                          textColor:(UIColor *)textColor
                        borderStyle:(UITextBorderStyle)borderStyle
                        placeholder:(NSString *)placeholder
                           delegate:(nullable id)delegate;

+ (UITextView *)textViewWithFrame:(CGRect)frame
                             font:(UIFont *)font
                    textAlignment:(NSTextAlignment)textAlignment
                        textColor:(UIColor *)textColor
                         delegate:(nullable id)delegate
                         editable:(BOOL)editable;

+ (UIScrollView *)scrollViewWithFrame:(CGRect)frame
       showsHorizontalScrollIndicator:(BOOL)showsHorizontalScrollIndicator
         showsVerticalScrollIndicator:(BOOL)showsVerticalScrollIndicator
                        pagingEnabled:(BOOL)pagingEnabled
                        scrollEnabled:(BOOL)scrollEnabled
                              bounces:(BOOL)bounces
                             delegate:(nullable id)delegate;

+ (UICollectionView *)collectionViewWithFrame:(CGRect)frame
                                   flowlayout:(UICollectionViewFlowLayout *)flowlayout
                                     delegate:(nullable id)delegate
                                   dataSource:(nullable id)dataSource;

+ (UICollectionViewFlowLayout *)flowLayoutWithLineSpace:(CGFloat)lineSpace
                                             interSpace:(CGFloat)interSpace
                                               itemSize:(CGSize)itemSize
                                      estimatedItemSize:(CGSize)estimatedItemSize
                                        scrollDirection:(UICollectionViewScrollDirection)scrollDirection
                                    headerReferenceSize:(CGSize)headerReferenceSize
                                    footerReferenceSize:(CGSize)footerReferenceSize
                                           sectionInset:(UIEdgeInsets)sectionInset;


@end

NS_ASSUME_NONNULL_END
